import json

import requests
from jenkinsapi.jenkins import Jenkins


def test_jenkins_jobbuild():
    url = "http://demo:wy235689@localhost:8080/job/用户旅程接口测试/build"
    re = requests.post(url)
    print(re.text)

def test_jenkins_jobbuild_2():
    baseurl = "http://demo:wy235689@localhost:8080/job/用户旅程接口测试/build"
    username='demo'
    password='wy235689'
    jk=Jenkins(baseurl,username,password,useCrumb=True)

def test_jenkinstask():
    url="http://demo:wy235689@localhost:8080/job/用户旅程接口测试/lastBuild/buildNumber"
    re=requests.get(url)
    print(re.text)
def test_taskstatus():
    url = "http://demo:wy235689@localhost:8080/job/用户旅程接口测试/33/api/json"
    re = requests.get(url)
    print(json.dumps(re.json(),indent=2))





